package com.study.concurrentprogramming.monitor;

import java.io.Serializable;

public class sync implements Serializable {
    static final Object obj = new Object();
    private static final long serialVersionUID = 420729043530142548L;

    public static void method1() {
        synchronized (obj) {
            method2();
        }
    }

    public static void method2() {
        synchronized (obj) {
            // 同步块
        }
    }
}
